package com.illya.controller;

import com.illya.exciption.IllyaExciption;
import com.illya.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyExcptionAdvice {

    @ExceptionHandler(IllyaExciption.class)
    public Result excptionAdvice(IllyaExciption illya) {
        return Result.error(illya.getMessage());
    }
}
